﻿using System;
using System.Collections.Generic;
using System.Text;
using BlueLotus7.Common;
using System.Runtime.Serialization;

namespace BlueLotus7.Contract
{
    [DataContract]
    [KnownType(typeof(BaseObject))]
    [KnownType(typeof(AccessLevel))]
    public class BaseResourceObject : BaseObject
    {
        [DataMember]
        protected AccessLevel accessType;
        [DataMember]
        protected string logicalFileName;
        [DataMember]
        protected string physicalFileName;

        public AccessLevel AccessType
        {
            get
            {
                return accessType;
            }
            set
            {
                accessType = value;
            }
        }

        public string LogicalFileName
        {
            get
            {
                return logicalFileName;
            }
            set
            {
                logicalFileName = value;
            }
        }

        public string PhysicalFileName
        {
            get
            {
                return physicalFileName;
            }
            set
            {
                physicalFileName = value;
            }
        }

        public BaseResourceObject(Guid key, string logicalFileName, DateTime insertedStamp, DateTime lastUpdatedStamp)
            : base(key, insertedStamp, lastUpdatedStamp)
        {
            this.logicalFileName = logicalFileName;
        }

        public BaseResourceObject(string logicalFileName)
            : base()
        {
            this.logicalFileName = logicalFileName;
        }
    }
}
